package com.nlelpct.manage.model.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author :小马
 * @date : 2023-07-12
 */
@Data
public final class PageResultVo<T> implements Serializable {

    private List<T> list;

    private Long total;

    public PageResultVo() {
    }

    public PageResultVo(List<T> list, Long total) {
        this.list = list;
        this.total = total;
    }

    public PageResultVo(Long total) {
        this.list = new ArrayList<>();
        this.total = total;
    }

    public static <T> PageResultVo<T> empty() {
        return new PageResultVo<>(0L);
    }

    public static <T> PageResultVo<T> empty(Long total) {
        return new PageResultVo<>(total);
    }
}
